package com.augmentum.springcloudorderservice.feignclient;

import com.augmentum.springcloudorderservice.domain.product.ProductInfo;
import com.augmentum.springcloudorderservice.dto.ProductDto;
import com.augmentum.springcloudproductservice.dto.UserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "PRODUCT-SERVICE-NAME")
public interface ProductClient {

    @PostMapping("/feign/msg")
    String hello(@RequestBody UserDTO userDTO);

    @PostMapping("/product/products")
    List<ProductInfo> findProductsByIds(@RequestBody List<String> productIds);

    @PutMapping("/product/products")
    String decreaseStock(@RequestBody List<ProductDto> productDtos);
}
